Optimal. Leaf size=121 \[ -\frac {4 (A+2 i B) c^3 x}{a}-\frac {4 (i A-2 B) c^3 \log (\cos (e+f x))}{a f}-\frac {4 (A+i B) c^3}{a f (i-\tan (e+f x))}+\frac {(A+4 i B) c^3 \tan (e+f x)}{a f}+\frac {B c^3 \tan ^2(e+f x)}{2 a f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.12, antiderivative size = 121, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {3669, 78}
\begin {gather*} \frac {c^3 (A+4 i B) \tan (e+f x)}{a f}-\frac {4 c^3 (A+i B)}{a f (-\tan (e+f x)+i)}-\frac {4 c^3 (-2 B+i A) \log (\cos (e+f x))}{a f}-\frac {4 c^3 x (A+2 i B)}{a}+\frac {B c^3 \tan ^2(e+f x)}{2 a f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 78
Rule 3669
Rubi steps
\begin {align*} \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^3}{a+i a \tan (e+f x)} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {(A+B x) (c-i c x)^2}{(a+i a x)^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left (\frac {(A+4 i B) c^2}{a^2}+\frac {B c^2 x}{a^2}-\frac {4 (A+i B) c^2}{a^2 (-i+x)^2}+\frac {4 i (A+2 i B) c^2}{a^2 (-i+x)}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {4 (A+2 i B) c^3 x}{a}-\frac {4 (i A-2 B) c^3 \log (\cos (e+f x))}{a f}-\frac {4 (A+i B) c^3}{a f (i-\tan (e+f x))}+\frac {(A+4 i B) c^3 \tan (e+f x)}{a f}+\frac {B c^3 \tan ^2(e+f x)}{2 a f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 3.28, size = 212, normalized size = 1.75 \begin {gather*} \frac {c^3 (\cos (f x)+i \sin (f x)) \left (-8 (A+2 i B) \text {ArcTan}(\tan (f x)) (\cos (e)+i \sin (e))+4 (-i A+2 B) \log \left (\cos ^2(e+f x)\right ) (\cos (e)+i \sin (e))+B \sec ^2(e+f x) (\cos (e)+i \sin (e))+4 (A+i B) \cos (2 f x) (i \cos (e)+\sin (e))+4 (A+i B) (\cos (e)-i \sin (e)) \sin (2 f x)+2 (A+4 i B) \sec (e+f x) \sin (f x) (1+i \tan (e))\right ) (A+B \tan (e+f x))}{2 f (A \cos (e+f x)+B \sin (e+f x)) (a+i a \tan (e+f x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.22, size = 81, normalized size = 0.67
method | result | size |
derivativedivides | \(\frac {c^{3} \left (A \tan \left (f x +e \right )+4 i B \tan \left (f x +e \right )+\frac {B \left (\tan ^{2}\left (f x +e \right )\right )}{2}+\left (4 i A -8 B \right ) \ln \left (-i+\tan \left (f x +e \right )\right )-\frac {-4 i B -4 A}{-i+\tan \left (f x +e \right )}\right )}{f a}\) | \(81\) |
default | \(\frac {c^{3} \left (A \tan \left (f x +e \right )+4 i B \tan \left (f x +e \right )+\frac {B \left (\tan ^{2}\left (f x +e \right )\right )}{2}+\left (4 i A -8 B \right ) \ln \left (-i+\tan \left (f x +e \right )\right )-\frac {-4 i B -4 A}{-i+\tan \left (f x +e \right )}\right )}{f a}\) | \(81\) |
norman | \(\frac {\frac {\left (4 i B \,c^{3}+A \,c^{3}\right ) \left (\tan ^{3}\left (f x +e \right )\right )}{a f}+\frac {\left (8 i B \,c^{3}+5 A \,c^{3}\right ) \tan \left (f x +e \right )}{a f}-\frac {4 \left (2 i B \,c^{3}+A \,c^{3}\right ) x}{a}-\frac {-8 i c^{3} A +9 B \,c^{3}}{2 a f}-\frac {4 \left (2 i B \,c^{3}+A \,c^{3}\right ) x \left (\tan ^{2}\left (f x +e \right )\right )}{a}+\frac {B \,c^{3} \left (\tan ^{4}\left (f x +e \right )\right )}{2 a f}}{1+\tan ^{2}\left (f x +e \right )}-\frac {2 \left (-i c^{3} A +2 B \,c^{3}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{a f}\) | \(192\) |
risch | \(-\frac {2 c^{3} {\mathrm e}^{-2 i \left (f x +e \right )} B}{a f}+\frac {2 i c^{3} {\mathrm e}^{-2 i \left (f x +e \right )} A}{a f}-\frac {16 i c^{3} B x}{a}-\frac {8 c^{3} A x}{a}-\frac {16 i c^{3} B e}{f a}-\frac {8 c^{3} A e}{f a}-\frac {2 c^{3} \left (-i A \,{\mathrm e}^{2 i \left (f x +e \right )}+3 B \,{\mathrm e}^{2 i \left (f x +e \right )}-i A +4 B \right )}{a f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2}}+\frac {8 c^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) B}{f a}-\frac {4 i c^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) A}{f a}\) | \(199\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 229 vs. \(2 (111) = 222\).
time = 3.24, size = 229, normalized size = 1.89 \begin {gather*} -\frac {2 \, {\left (4 \, {\left (A + 2 i \, B\right )} c^{3} f x e^{\left (6 i \, f x + 6 i \, e\right )} + {\left (-i \, A + B\right )} c^{3} + 2 \, {\left (4 \, {\left (A + 2 i \, B\right )} c^{3} f x + {\left (-i \, A + 2 \, B\right )} c^{3}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (4 \, {\left (A + 2 i \, B\right )} c^{3} f x + 3 \, {\left (-i \, A + 2 \, B\right )} c^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + 2 \, {\left ({\left (i \, A - 2 \, B\right )} c^{3} e^{\left (6 i \, f x + 6 i \, e\right )} + 2 \, {\left (i \, A - 2 \, B\right )} c^{3} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (i \, A - 2 \, B\right )} c^{3} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )\right )}}{a f e^{\left (6 i \, f x + 6 i \, e\right )} + 2 \, a f e^{\left (4 i \, f x + 4 i \, e\right )} + a f e^{\left (2 i \, f x + 2 i \, e\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.49, size = 265, normalized size = 2.19 \begin {gather*} \frac {2 i A c^{3} - 8 B c^{3} + \left (2 i A c^{3} e^{2 i e} - 6 B c^{3} e^{2 i e}\right ) e^{2 i f x}}{a f e^{4 i e} e^{4 i f x} + 2 a f e^{2 i e} e^{2 i f x} + a f} + \begin {cases} \frac {\left (2 i A c^{3} - 2 B c^{3}\right ) e^{- 2 i e} e^{- 2 i f x}}{a f} & \text {for}\: a f e^{2 i e} \neq 0 \\x \left (- \frac {- 8 A c^{3} - 16 i B c^{3}}{a} + \frac {\left (- 8 A c^{3} e^{2 i e} + 4 A c^{3} - 16 i B c^{3} e^{2 i e} + 4 i B c^{3}\right ) e^{- 2 i e}}{a}\right ) & \text {otherwise} \end {cases} - \frac {4 i c^{3} \left (A + 2 i B\right ) \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a f} + \frac {x \left (- 8 A c^{3} - 16 i B c^{3}\right )}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 323 vs. \(2 (111) = 222\).
time = 0.69, size = 323, normalized size = 2.67 \begin {gather*} \frac {2 \, {\left (\frac {2 \, {\left (-i \, A c^{3} + 2 \, B c^{3}\right )} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}{a} - \frac {4 \, {\left (-i \, A c^{3} + 2 \, B c^{3}\right )} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - i\right )}{a} - \frac {2 \, {\left (i \, A c^{3} - 2 \, B c^{3}\right )} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1\right )}{a} - \frac {5 \, A c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 8 i \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 2 i \, A c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 7 \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 10 \, A c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 14 i \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 2 i \, A c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 7 \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 5 \, A c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 8 i \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - i \, \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + i\right )}^{2} a}\right )}}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.70, size = 136, normalized size = 1.12 \begin {gather*} \frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (-\frac {8\,B\,c^3}{a}+\frac {A\,c^3\,4{}\mathrm {i}}{a}\right )}{f}+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (\frac {c^3\,\left (A+B\,2{}\mathrm {i}\right )}{a}+\frac {B\,c^3\,2{}\mathrm {i}}{a}\right )}{f}+\frac {\frac {4\,B\,c^3}{a}+\frac {\left (4\,A\,c^3+B\,c^3\,8{}\mathrm {i}\right )\,1{}\mathrm {i}}{a}}{f\,\left (1+\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}+\frac {B\,c^3\,{\mathrm {tan}\left (e+f\,x\right )}^2}{2\,a\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________